// 地址管理
import http from "@/utils/http";

// 新增地址 
export function postmemberaddress(data){
    return http({
    
        url:"/member/address",
        method:'POST',
        data
    })
 }

//  获取地址列表 
export function getmemberaddress(){
    return http({
        url:"/member/address",
        
    })
}
  
// 编辑地址获取地址详情进行数据回填 /member/address/{id}
export function getmemberaddressdetail(id){
    return http({
        url:`/member/address/${id}`,
        method:'get'
    })
}

/**
 * 更新收货地址
 * @param {Number} id 修改的地址id
 * @param {Object} data  修改的地址数据
 * @returns 
 */
export function putmemberaddress(id,data){
    return http({
        url:`/member/address/${id}`,
        method:'put',
        data
    })
}

// 删除地址
export function delmemberaddress(id){
    return http({
        url:`/member/address/${id}`,
        method:'delete'
    })
}